package com.initial.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.initial.entity.TbCrmAnnouncement;
import com.initial.service.TbCrmAnnouncementService;
import com.initial.mapper.TbCrmAnnouncementMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

/**
* @author 余小年
* @description 针对表【tb_crm_announcement】的数据库操作Service实现
* @createDate 2021-12-14 17:21:59
*/
@Service
@Transactional
public class TbCrmAnnouncementServiceImpl extends ServiceImpl<TbCrmAnnouncementMapper, TbCrmAnnouncement>
    implements TbCrmAnnouncementService{
    @Resource
    private TbCrmAnnouncementMapper tbCrmAnnouncementMapper;

    @Override
     public List<TbCrmAnnouncement> selectAllPage( Integer page, Integer rows, String title, String departmentid){
        List<TbCrmAnnouncement> tbCrmAnnouncements = tbCrmAnnouncementMapper.selectAllPage((page-1)*rows, rows, title, departmentid);
        return tbCrmAnnouncements;
    }

    @Override
    public Integer selectAllCount(String title, String departmentid) {
        Integer integer = tbCrmAnnouncementMapper.selectAllCount(title, departmentid);
        return integer;
    }

    @Override
    public TbCrmAnnouncement selectById(Integer id) {
        TbCrmAnnouncement tbCrmAnnouncement = tbCrmAnnouncementMapper.selectById(id);
        return tbCrmAnnouncement;
    }

    @Override
    public Integer deleteById(Integer id) {
        Integer integer = tbCrmAnnouncementMapper.deleteById(id);
        return integer;
    }
}




